package com.ruoyi.fantasy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fantasy.mapper.FantasyBankAccountMapper;
import com.huanzhidadi.fantasy.bean.domain.FantasyBankAccount;
import com.ruoyi.fantasy.service.IFantasyBankAccountService;
import com.ruoyi.common.core.text.Convert;

/**
 * 银行账户Service业务层处理
 * 
 * @author wanghui
 * @date 2020-06-18
 */
@Service
public class FantasyBankAccountServiceImpl implements IFantasyBankAccountService 
{
    @Autowired
    private FantasyBankAccountMapper fantasyBankAccountMapper;

    /**
     * 查询银行账户
     * 
     * @param id 银行账户ID
     * @return 银行账户
     */
    @Override
    public FantasyBankAccount selectFantasyBankAccountById(String id)
    {
        return fantasyBankAccountMapper.selectFantasyBankAccountById(id);
    }

    /**
     * 查询银行账户列表
     * 
     * @param fantasyBankAccount 银行账户
     * @return 银行账户
     */
    @Override
    public List<FantasyBankAccount> selectFantasyBankAccountList(FantasyBankAccount fantasyBankAccount)
    {
        return fantasyBankAccountMapper.selectFantasyBankAccountList(fantasyBankAccount);
    }

    /**
     * 新增银行账户
     * 
     * @param fantasyBankAccount 银行账户
     * @return 结果
     */
    @Override
    public int insertFantasyBankAccount(FantasyBankAccount fantasyBankAccount)
    {
        fantasyBankAccount.setCreateTime(DateUtils.getNowDate());
        return fantasyBankAccountMapper.insertFantasyBankAccount(fantasyBankAccount);
    }

    /**
     * 修改银行账户
     * 
     * @param fantasyBankAccount 银行账户
     * @return 结果
     */
    @Override
    public int updateFantasyBankAccount(FantasyBankAccount fantasyBankAccount)
    {
        return fantasyBankAccountMapper.updateFantasyBankAccount(fantasyBankAccount);
    }

    /**
     * 删除银行账户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFantasyBankAccountByIds(String ids)
    {
        return fantasyBankAccountMapper.deleteFantasyBankAccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除银行账户信息
     * 
     * @param id 银行账户ID
     * @return 结果
     */
    @Override
    public int deleteFantasyBankAccountById(String id)
    {
        return fantasyBankAccountMapper.deleteFantasyBankAccountById(id);
    }
}
